@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";
@custom-variant dark (&:is(.dark *));

:root {
  --background: oklch(0.9755 0.0045 258.3245);
  --foreground: oklch(0.2558 0.0433 268.0662);
  --card: oklch(0.9341 0.0132 251.5628);
  --card-foreground: oklch(0.2558 0.0433 268.0662);
  --popover: oklch(0.9856 0.0278 98.0540);
  --popover-foreground: oklch(0.2558 0.0433 268.0662);
  --primary: oklch(0.4815 0.1178 263.3758);
  --primary-foreground: oklch(0.9856 0.0278 98.0540);
  --secondary: oklch(0.8567 0.1164 81.0092);
  --secondary-foreground: oklch(0.2558 0.0433 268.0662);
  --muted: oklch(0.9202 0.0080 106.5563);
  --muted-foreground: oklch(0.4815 0.1178 263.3758);
  --accent: oklch(0.6896 0.0714 234.0387);
  --accent-foreground: oklch(0.9856 0.0278 98.0540);
  --destructive: oklch(0.2611 0.0376 322.5267);
  --destructive-foreground: oklch(0.9856 0.0278 98.0540);
  --border: oklch(0.7791 0.0156 251.1926);
  --input: oklch(0.6896 0.0714 234.0387);
  --ring: oklch(0.8567 0.1164 81.0092);
  --chart-1: oklch(0.4815 0.1178 263.3758);
  --chart-2: oklch(0.8567 0.1164 81.0092);
  --chart-3: oklch(0.6896 0.0714 234.0387);
  --chart-4: oklch(0.7791 0.0156 251.1926);
  --chart-5: oklch(0.2611 0.0376 322.5267);
  --sidebar: oklch(0.9341 0.0132 251.5628);
  --sidebar-foreground: oklch(0.2558 0.0433 268.0662);
  --sidebar-primary: oklch(0.4815 0.1178 263.3758);
  --sidebar-primary-foreground: oklch(0.9856 0.0278 98.0540);
  --sidebar-accent: oklch(0.8567 0.1164 81.0092);
  --sidebar-accent-foreground: oklch(0.2558 0.0433 268.0662);
  --sidebar-border: oklch(0.7791 0.0156 251.1926);
  --sidebar-ring: oklch(0.8567 0.1164 81.0092);
  --font-sans: Libre Baskerville, serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 0.5rem;
  --shadow-x: 0;
  --shadow-y: 1px;
  --shadow-blur: 3px;
  --shadow-spread: 0px;
  --shadow-opacity: 0.1;
  --shadow-color: oklch(0 0 0);
  --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
  --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
  --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
  --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
  --tracking-normal: 0em;
  --spacing: 0.25rem;
}

.dark {
  --background: oklch(0.2204 0.0198 275.8439);
  --foreground: oklch(0.9366 0.0129 266.6974);
  --card: oklch(0.2703 0.0407 281.3036);
  --card-foreground: oklch(0.9366 0.0129 266.6974);
  --popover: oklch(0.2703 0.0407 281.3036);
  --popover-foreground: oklch(0.9097 0.1440 95.1120);
  --primary: oklch(0.4815 0.1178 263.3758);
  --primary-foreground: oklch(0.9097 0.1440 95.1120);
  --secondary: oklch(0.9097 0.1440 95.1120);
  --secondary-foreground: oklch(0.2703 0.0407 281.3036);
  --muted: oklch(0.2424 0.0324 281.0890);
  --muted-foreground: oklch(0.6243 0.0412 262.0375);
  --accent: oklch(0.8469 0.0524 264.7751);
  --accent-foreground: oklch(0.2204 0.0198 275.8439);
  --destructive: oklch(0.5280 0.1200 357.1130);
  --destructive-foreground: oklch(0.9097 0.1440 95.1120);
  --border: oklch(0.3072 0.0287 281.7681);
  --input: oklch(0.4815 0.1178 263.3758);
  --ring: oklch(0.9097 0.1440 95.1120);
  --chart-1: oklch(0.4815 0.1178 263.3758);
  --chart-2: oklch(0.9097 0.1440 95.1120);
  --chart-3: oklch(0.6896 0.0714 234.0387);
  --chart-4: oklch(0.6243 0.0412 262.0375);
  --chart-5: oklch(0.5280 0.1200 357.1130);
  --sidebar: oklch(0.2703 0.0407 281.3036);
  --sidebar-foreground: oklch(0.9366 0.0129 266.6974);
  --sidebar-primary: oklch(0.4815 0.1178 263.3758);
  --sidebar-primary-foreground: oklch(0.9097 0.1440 95.1120);
  --sidebar-accent: oklch(0.9097 0.1440 95.1120);
  --sidebar-accent-foreground: oklch(0.2703 0.0407 281.3036);
  --sidebar-border: oklch(0.3072 0.0287 281.7681);
  --sidebar-ring: oklch(0.9097 0.1440 95.1120);
  --font-sans: Libre Baskerville, serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 0.5rem;
  --shadow-x: 0;
  --shadow-y: 1px;
  --shadow-blur: 3px;
  --shadow-spread: 0px;
  --shadow-opacity: 0.1;
  --shadow-color: oklch(0 0 0);
  --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
  --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
  --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
  --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);

  --font-sans: var(--font-sans);
  --font-mono: var(--font-mono);
  --font-serif: var(--font-serif);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --shadow-2xs: var(--shadow-2xs);
  --shadow-xs: var(--shadow-xs);
  --shadow-sm: var(--shadow-sm);
  --shadow: var(--shadow);
  --shadow-md: var(--shadow-md);
  --shadow-lg: var(--shadow-lg);
  --shadow-xl: var(--shadow-xl);
  --shadow-2xl: var(--shadow-2xl);
}

/* 在你的样式文件中添加 */
.rjv-default {
  background-color: #1a1a1a;
  color: #e6e6e6;
}
.rjv-default .object-key-val {
  color: #9acd32;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}


@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.animate-marquee {
  animation: marquee 20s linear infinite; /* 这里的20s可以根据需要调整速度 */
}

.pre-wrap {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 这里定义你自己的样式变量和拓展 */
@theme {
  --heading-indent-h1: 0rem;
  --heading-indent-h2: 0.5rem;
  --heading-indent-h3: 1rem;
  --heading-indent-h4: 1.5rem;
  --heading-indent-h5: 2rem;
  --heading-indent-h6: 2.5rem;

  --heading-size-h1: 1.5rem;   /* text-xl */
  --heading-size-h2: 1.25rem;  /* text-lg */
  --heading-size-h3: 1.125rem; /* text-base */
  --heading-size-h4: 1rem;     /* text-sm */
  --heading-size-h5: 0.875rem; /* text-xs */
  --heading-size-h6: 0.8rem; /* text-xs */
}

/* 自定义 prose 风格 */
@layer utilities {
  .prose-custom {
    @apply prose prose-sm max-w-none leading-snug;

    @apply [&_p]:indent-[0.5em];

    /* 取消默认 margin */
    @apply [&_h1]:my-1 [&_h2]:my-1 [&_h3]:my-1 [&_h4]:my-1 [&_h5]:my-1 [&_h6]:my-1;

    /* 字号控制 */
    @apply 
      [&_h1]:text-[var(--heading-size-h1)]
      [&_h2]:text-[var(--heading-size-h2)]
      [&_h3]:text-[var(--heading-size-h3)]
      [&_h4]:text-[var(--heading-size-h4)]
      [&_h5]:text-[var(--heading-size-h5)]
      [&_h6]:text-[var(--heading-size-h6)];

    /* 防止标号与文字重叠，可加左内边距 */
    @apply [&_ol]:ml-[1em] [&_ul]:ml-[1em];
    @apply [&_.mermaid]:bg-white [&_.mermaid]:text-black;
  }
}
